package test;

import java.util.ArrayList;

public class methodResult {

	private Integer id = -1;
	private String type = "";
	private ArrayList<Integer> ligne = null;
	
	public methodResult(String iDMethode,String type){
		this.setId(Integer.parseInt(iDMethode));
		this.ligne = new ArrayList<Integer>();
		this.setType(type);
	}

	
	public String printLines(){
		String lines = "";
		if(this.ligne.size()==0){
			return lines="No error";
		}
		else{
			lines += this.ligne.get(0);
			if (this.ligne.size() > 1){
				for (int i=1; i<this.ligne.size();i++){
					lines += " / " + this.ligne.get(i);
				}
			}
			return lines;
		}
	}
	
	public void setLigne(ArrayList<Integer> ligne) {
		this.ligne = ligne;
	}

	public ArrayList<Integer> getLigne() {
		return ligne;
	}
	
	public void addLigne(Integer l) {
		this.ligne.add(l);
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getType() {
		return type;
	}
}
